package zzz.Text.text11;
public class Mathdemo {
    public static void main(String[] args) {
        //abs 获取参数绝对值
        System.out.println(Math.abs(-80));
        System.out.println(Math.abs(88));
        //bug:
        //以int类型为例,取值范围:-2147483648 ~ 2147483647
        System.out.println(Math.abs(-2147483648));
        //进一法
        System.out.println(Math.ceil(12.54));
        //去尾法
        System.out.println(Math.floor(12.54));
        //四舍五入
        System.out.println(Math.round(12.54));
        System.out.println(Math.round(12.44));
        //获取两个整数的较大值
        System.out.println(Math.max(20, 30));
        //获取两个整数的较小值
        System.out.println(Math.min(20, 30));
        //获取a的b次幂
        System.out.println(Math.pow(2, 3));
        //开根号
        System.out.println(Math.sqrt(4));
        System.out.println(Math.cbrt(8));
        //求随机数(0.0,1.0)
        System.out.println(Math.random());//
    }
}
